//
//  SLHomeDeviceLogCell.m
//  SlockApp
//
//  Created by 凯朱 on 2024/7/12.
//

#import "SLHomeDeviceLogCell.h"

@implementation SLHomeDeviceLogCell

- (void)awakeFromNib {
    [super awakeFromNib];
//    _label1.font = _label2.font = _label3.font = kFont(14);
    
}

-(void)setModel:(SLLockLogModel *)model{
    _model = model;
    
    if (kSTRING(model.warnType).length > 0) {
        _label1.textColor = _label2.textColor = _label3.textColor = KRedColor;
        NSArray *warnStrs = [ZCTool warnStrWith:[model.warnType integerValue]];
        _label1.text = warnStrs[0];
        NSString *time = [NSString timeStringFromTimestamp:model.unlockTime formart:@"HH:mm MMM d"];
        _label2.text = time;
        _label3.text = kLocalString(@"Warning.");
    }else{
        _label1.textColor = _label2.textColor = _label3.textColor = KWhiteColor_text;
        _label1.text = kReplace(model.unlockUame, kSTRING(@"Unkown"));
        NSString *time = [NSString timeStringFromTimestamp:model.unlockTime formart:@"HH:mm MMM d"];
        _label2.text = time;
        NSString *typeName = [model.unlockType isEqualToString:@"3"] ? kLocalString(@"Fingerprint") : kLocalString(@"App");
        _label3.text = typeName;
    }
    NSLog(@"_label1 fontName = %@",_label1.font);
}

@end
